#ifndef QT_URL_EDITOR_FACTORY
#define QT_URL_EDITOR_FACTORY

#include <QWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QHBoxLayout>
#include <qtpropertybrowser.h>
#include <qtvariantproperty.h>
#include <QtUrlEditorManager.h>
#include <QUrl>
class UrlEditWidget : public QWidget
{
    Q_OBJECT
public:
    UrlEditWidget(QWidget * parent = 0, Qt::WindowFlags f = 0);
    virtual ~UrlEditWidget();
    void setValue(const QUrl& text);
    void setFilter(const QString& filter_str);

    QUrl getLineText();

protected slots:
    void SlotButtonClicked();
signals:
    void signalUrlStrChanged(const QUrl& url_str);
protected:
    QHBoxLayout* m_Hboxlayout;
    QLineEdit* m_lineEdit;
    QPushButton* m_pushButton;

};

class QtUrlEditorFactory : public QtAbstractEditorFactory<QtUrlEditorManager>
{
    Q_OBJECT
public:
    QtUrlEditorFactory(QObject *parent=0);
    virtual ~QtUrlEditorFactory();


protected:
    virtual void connectPropertyManager (QtUrlEditorManager *manager);
    virtual QWidget * createEditor (QtUrlEditorManager *manager, QtProperty *property, QWidget *parent);
    virtual void disconnectPropertyManager (QtUrlEditorManager *manager);
private slots:
    void slotSetValue(const QUrl& url_str);
private:
    QMap<QtProperty *, UrlEditWidget* > m_propertyToWidget;
    QMap<UrlEditWidget *, QtProperty *> m_WidgetToProperty;
};

#endif // QT_URL_EDITOR_FACTORY
